package com.ffyc.ssm.service;


import com.ffyc.ssm.dao.UserLoginDao;
import com.ffyc.ssm.modle.User;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserLoginService {

    @Autowired
    UserLoginDao userLoginDao;

//    用户注册
    public void Userregister(User user) {
        String password= DigestUtils.md5Hex(user.getPassword());
        user.setPassword(password);
        userLoginDao.userregister(user);
    }

    public User Login(User user) {
        String password= DigestUtils.md5Hex(user.getPassword());
        user.setPassword(password);
        return userLoginDao.Login(user);
    }
}
